package com.idanchuang.component.core;

import com.idanchuang.component.core.util.SpringUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * @author yjy
 * @date 2019/12/31 15:14
 **/
@Configuration
public class ComponentCoreAutoConfiguration {

    @Bean("componentCoreServiceInfo")
    public ServiceInfo serviceInfo(Environment env) {
        return new ServiceInfo(env);
    }

    @Bean
    @ConditionalOnMissingBean(name = "componentCoreSpringUtil")
    public SpringUtil componentCoreSpringUtil() {
        return new SpringUtil();
    }

}
